
<%--
 *  File:    YearPlanManagementDetailLeft.jsp
 *  @Author: belvieli
 *  Date:    2013/05/31
 *
 *  Copyright (C) 2000 - 2009 Oval Technologies, Inc.
 *  All rights reserved. 
 *
 *  This software is the confidential and proprietary information of Oval 
 *  Technologies, Inc. ("Confidential Information").  You shall not
 *  disclose such Confidential Information and shall use it only in
 *  accordance with the terms of the license agreement you entered into
 *  with Oval.
--%>


<%@ include file="/inc/SessionTimeout.inc"%>
<%@ page language="java" %>     
<%@ page import="java.util.*" %>
<%@ page import="org.apache.log4j.Category" %>

<%@ page contentType = "text/html;charset=UTF-8" %>
<%@ taglib uri="/WEB-INF/PageFlow.tld" prefix="PageFlow" %>
<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %>
<%@ taglib uri="/WEB-INF/oval-tag.tld" prefix="oval" %>
<%@ taglib uri="/WEB-INF/custom.tld" prefix="custom" %>
<%
  //init param
  String strTableName = "";
  String strModuleName = "COM";
  String privilegeCode = "FP0202";
  String contextPath = request.getContextPath(); 
%>
<%@ include file="/inc/Security.inc" %>
<%@ include file="/inc/FrmDefault.inc" %>
<%@ include file="/inc/PageDefault.inc" %>

<html>
<head>
<title>PlanTypeManagement</title>
<PageFlow:CheckPageFlow pageName="p_yearplandetailleft"/>
<%@ include file="/inc/CatchError.inc" %>
<%
	String isNew = "";
	String isDefault = "";
	String paraIsDefault = "";
/*	if("Y".equals(((String)pageContext.getAttribute("isdefault")))||"Y".equals(request.getParameter("isdefault"))) {
		isDefault = "&isdefault=Y";
		paraIsDefault="Y";
	}else if("N".equals(((String)pageContext.getAttribute("isdefault")))||"Y".equals(request.getParameter("isdefault"))) {
		isDefault = "&isdefault=N";
		paraIsDefault="N";
	}
	*/
	String yearplanid = "";
	if (request.getParameter("yearplanid") != null ){
		yearplanid = request.getParameter("yearplanid")+"";
	}else{
		yearplanid = session.getAttribute("yearplanid")+"";
	}
	
	String planlevel = "";
	if (request.getParameter("planlevel") != null ){
		planlevel = request.getParameter("planlevel")+"";
	}else{
		planlevel = session.getAttribute("planlevel")+"";
	}
%>
<meta http-equiv="Content-Type" content="text/html; charset=GB2312">
<link rel="stylesheet" href="<%=contextPath %>/css/<%= strLanguageCode %>/main.css" type="text/css">
<script language="JavaScript" src="<%=contextPath %>/css/<%= strLanguageCode %>/script.js"></script>
<script language="JavaScript" src="<%=contextPath %>/js/FuncLib.js"></script>
<script language="JavaScript" src="<%=contextPath %>/js/ScriptLib.js"></script>
<%@ include file="/inc/SummaryDivision.inc" %>
<script language="JavaScript" src="../../js/SummaryDivision.js"></script>
<%
HashMap CurUserInfo = (HashMap)session.getAttribute("userinfo");
Integer employeeid=(Integer)CurUserInfo.get("userid");
String  isadmin=(String)CurUserInfo.get("isadmin");
if(isadmin==null) isadmin="";
%>
<script language="JavaScript">
</script>
</head>
<body>
<form name="frm" method="post" action="<%=contextPath %>/Dispatcher">
<input type="hidden" name="pagename" value=p_yearplandetailleft>
<input type="hidden" name="actionname">
<input type="hidden" name="yearplanid" value = "<%=yearplanid %>">
<input type="hidden" name="isdefault" value="<%= paraIsDefault %>">
<table width="100%" cellspacing="0" cellpadding="0" border="0">
  <tr> 
    <td> 
      <table width="100%" border="0" cellspacing="0">
        <tr>
          <td>    
			<custom:select property="planlevel" optionsName="collection" optionValueKey="value" optionInnerTextKey="valuename" value = "<%=planlevel %>" defaultValue="---------" onchange = "page_summary('search')"/> 
          </td>
        </tr>
      </table>
    </td>
  </tr>
  <tr> 
    <td> 
      <table border="1" cellspacing="0" bordercolorlight="#999999" bordercolordark="#FFFFFF" cellpadding="0" width="100%">
          <tr class="deepblue-left">
            <%  if (planlevel.equals("5")) { %>         
            <td  class="title_center"><%= label.getLabelName("L_Representative")%></td>
            <td  class="title_center"><%= label.getLabelName("L_Region")%></td>
            <%} else  { %>
          <td  class="title_center"><%= label.getLabelName("L_last")%></td>
            <%} %>
            <%if(planlevel.equals("1")) {%>
            <td  class="title_center"><%= label.getLabelName("L_Dept")%></td>
            <%}else if (planlevel.equals("2")){ %>
            <td  class="title_center"><%= label.getLabelName("L_Provicetdr")%></td>
            <%}else if (planlevel.equals("3")){ %>
            <td  class="title_center"><%= label.getLabelName("L_RegionOffice")%></td>
            <%}else if (planlevel.equals("4")){ %>
            <td  class="title_center"><%= label.getLabelName("L_Representative")%></td>
             <%}else if (planlevel.equals("5")){ %>
            <td  class="title_center"><%= label.getLabelName("L_Customer")%></td>
            <%}else if (planlevel.equals("6")){ %>
            
            <td  class="title_center"><%= label.getLabelName("L_Doctor")%></td>
           <%} %>
             <!-- 
            <td  class="title_center"><%= label.getLabelName("L_ProductGroupName")%></td>
             -->
            <td  class="title_center"><%= label.getLabelName("L_Products")%></td>
            <td  class="title_center"><%= label.getLabelName("L_Month_1")%></td>
            <td  class="title_center"><%= label.getLabelName("L_Month_2")%></td>
            <td  class="title_center"><%= label.getLabelName("L_Month_3")%></td>
            <td  class="title_center"><%= label.getLabelName("L_Month_4")%></td>
            <td  class="title_center"><%= label.getLabelName("L_Month_5")%></td>
            <td  class="title_center"><%= label.getLabelName("L_Month_6")%></td>
            <td  class="title_center"><%= label.getLabelName("L_Month_7")%></td>
            <td  class="title_center"><%= label.getLabelName("L_Month_8")%></td>
            <td  class="title_center"><%= label.getLabelName("L_Month_9")%></td>
            <td  class="title_center"><%= label.getLabelName("L_Month_10")%></td>
            <td  class="title_center"><%= label.getLabelName("L_Month_11")%></td>
            <td  class="title_center"><%= label.getLabelName("L_Month_12")%></td>
            <!-- <td  class="title_center"><%= label.getLabelName("L_version")%></td> -->
            <td  class="title_center"><%= label.getLabelName("L_CreateUserName")%></td>
            <td  class="title_center"><%= label.getLabelName("L_CreatDate")%></td>
            <td  class="title_center"><%= label.getLabelName("L_LastUpdateDate")%></td>
		</tr>

          <%
           
          	 Vector detailvec = (Vector)pageContext.getAttribute("detailvec");
             if(detailvec == null)
             {
            	 detailvec = new Vector();
             }
             
          	 Vector productgroup = (Vector)pageContext.getAttribute("productgroup");
             if(productgroup == null)
             {
            	 productgroup = new Vector();
             }
             
             String strClassType = new String("");   
             Integer nDefaultId = null;             
             Integer nDefaultStatus = null;
             Integer nDefaultVersion = new Integer(-1);
             int i=0;
             String strChecked = "";
             boolean bHasChecked = false;
          %>   
          <logic:iterate id="yearplandetail" collection="<%= detailvec %>">
          <%
            if(i%2 == 1)
            {
              strClassType = "td-listrom";
            }else{                    
              strClassType = "none";
            }
            if(!bHasChecked)
            {
              bHasChecked = true;
              strChecked = "Checked";
            }
            else
            {
              strChecked = "";
            }
            i++;
          %>            
          <tr onMouseOver="this.className='tr-over'" onMouseOut="this.className='<%=JspHelper.filterNull( strClassType )%>'"> 
            <!-- 
            <td><custom:write name="yearplandetail" property="deptid" nbsp="true"/></td>
            <td><custom:write name="yearplandetail" property="stdareaid" nbsp="true"/></td>
            <td><custom:write name="yearplandetail" property="areaid" nbsp="true"/></td>
            <td><custom:write name="yearplandetail" property="salesrepid" nbsp="true"/></td>
            
            <td><custom:write name="yearplandetail" property="productgroupid" nbsp="true"/></td>
             -->  
             <%   if (planlevel.equals("5")){ %>         
             <td><custom:write name="yearplandetail" property="salesrepname" nbsp="true"/></td>
             <%} %>
            <td><custom:write name="yearplandetail" property="parentid" nbsp="true"/></td>
            <td><custom:write name="yearplandetail" property="currentid" nbsp="true"/></td>
            <td><custom:write name="yearplandetail" property="productgroupname" nbsp="true"/></td>
            <td><custom:write name="yearplandetail" property="jan" nbsp="true"/></td>
            <td><custom:write name="yearplandetail" property="feb" nbsp="true"/></td>
            <td><custom:write name="yearplandetail" property="thu" nbsp="true"/></td>
            <td><custom:write name="yearplandetail" property="mar" nbsp="true"/></td>
            <td><custom:write name="yearplandetail" property="may" nbsp="true"/></td>
            <td><custom:write name="yearplandetail" property="june" nbsp="true"/></td>
            <td><custom:write name="yearplandetail" property="july" nbsp="true"/></td>
            <td><custom:write name="yearplandetail" property="aug" nbsp="true"/></td>
            <td><custom:write name="yearplandetail" property="sep" nbsp="true"/></td>
            <td><custom:write name="yearplandetail" property="oct" nbsp="true"/></td>
            <td><custom:write name="yearplandetail" property="nov" nbsp="true"/></td>
            <td><custom:write name="yearplandetail" property="dec" nbsp="true"/></td>
            <!-- 
            <td>
            <custom:write name="yearplandetail" property="versionnum" nbsp="true"/></td>
             -->
            <td><custom:write name="yearplandetail" property="employeename" nbsp="true"/></td>
            <td><custom:write name="yearplandetail" property="createdate" nbsp="true"/></td>
            <td><custom:write name="yearplandetail" property="datelastupdated" nbsp="true"/></td>
          </tr>
          </logic:iterate> 
        <%@ include file="/inc/SummaryAction.inc" %>
      </table>
    </td>
  </tr>
</table>
 </form>
</body>
<script type="text/javascript">

function page_summary(actionvalue,orderbyname)
{
  var editform = summaryPrepare(frm,actionvalue,orderbyname);
  editform.action = "YearPlanManagementDetailLeft.jsp?<%= OvalTools.randomURL() %><%=JspHelper.filterNull(isDefault)%>&languagecode=<%= strLanguageCode %>";
  editform.target = "_self";
  isRunning = true;
  editform.submit();  
}
</script>
</html>
